{% extends "base.html" %}

{% block title %}{% if article %}{{ article.title }}{% endif %}{% endblock %}
{% block styles %}
{{ super() }}
<link href="{{ url_for('static', filename='default/css/page_article_view.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ url_for('static', filename='default/css/article_comment_list.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ url_for('static', filename='plug-in/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css') }}" rel="stylesheet" type="text/css" />
{% endblock %}

{% block content %}
<div style="clear:both;"></div>
<div class="layout_header"></div>
<div style="clear:both;"></div>
<div class="layout_body">
    <div style="clear:both;"></div>
    <div class="layout_row1">
        <div style="clear:both;"></div>
        <div class="layout_left ">
            {% if article %}
                <div id="article_title">
                    <h1>{{ article.title }}</h1>
                </div>
                <div id="article_meta">
                    <span class="mr15">
                        {{ strs.page_article_view.author }}
                        <a href="{{ url_for('main.user_domain', unique_domain = article.author_domain) }}">{{ article.author_name }}</a>
                    </span>
                    <span class="mr15">{{ strs.page_article_view.update_at }}{{ article.update_time }}</span>
                    {% if (current_user.is_authenticated() and current_user.id == article.author_id) %}
                    <span><a href="{{ url_for('main.admin_article', action='update', articleId=article.id) }}">{{ strs.page_article_view.edit }}</a></span>
                    {% endif %}
                    <div>
                        <div class="tags-list">
                            {% for tag_name in tag_list %}
                            <a href="{{ url_for('main.tag_search', tag_name=tag_name) }}" class="label">{{ tag_name }}</a>
                            {% endfor %}
                        </div>
                        <div style="clear:both;"></div>
                    </div>
                </div>
                <div style="clear:both;"></div>
                <div id="article_body">
                    {{ article.body_default | safe }}
                    <script type="text/javascript">SyntaxHighlighter.all();</script>
                </div>
                <div id="article_evaluate"></div>
                {% include 'default/article_comment_list.html' %}
            {% else %}
                <h1>Article not exist!</h1>
            {% endif %}
        </div>
        <div class="layout_right">
        </div>
    </div>
</div>
<div style="clear:both;"></div>

{% endblock %}

{% block scripts %}
{{ super() }}
<script src="{{ url_for('static', filename='plug-in/jquery_lazyload/jquery.lazyload.min.js') }}" type="text/javascript"></script>
<script src="{{ url_for('static', filename='plug-in/ueditor/third-party/SyntaxHighlighter/shCore.js') }}" type="text/javascript"></script>
<script src="{{ url_for('static', filename='default/js/page_article_view.js') }}" type="text/javascript"></script>
{% endblock %}